<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAkbusPayGonglingTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('akbus_pay_gongling', function (Blueprint $table) {
            $table->id();
            $table->date('date')->nullable()->comment('月份');
            $table->unsignedBigInteger('personnel_id')->comment('人员ID');
            $table->foreign('personnel_id')->references('id')->on('akbus_personnel')->onDelete('cascade');
            $table->integer('line')->nullable()->comment('线路');
            $table->decimal('salary', 10, 2)->nullable()->comment('工龄工资');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('akbus_pay_gongling');
    }
}
